<template>
  <div>
    <h3>研究动态组件</h3>
    <button @click="comName = 'qrcode'">扫码登录</button>
    <button @click="comName = 'loginForm'">账号登录</button>

    <!-- 其实这里不用动态组件，用v-if也能实现，但是v-if的话这里就要写很多代码了 -->
    <!-- <keep-alive> -->
      <component :is="comName" />
    <!-- </keep-alive> -->
  </div>
</template>

<script>
import loginForm from "./components/loginForm";
import qrcode from "./components/qrcode";
export default {
  components: {
    loginForm,
    qrcode,
  },

  data() {
    return {
      comName: "loginForm",
    };
  },
};
</script>

<style>
</style>